/* ：root 全局样式 */
:root{
    --success-color:#2ecc71;
    --error-color:#e74c3c;
}
*{
    margin: 0;
    padding: 0;
    /* 设置成怪异盒子模型  padding border向内发展*/
    box-sizing: border-box;
}
body{
    background-color: #f9fafb;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.container{
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.3);
    border-radius: 5px;
    width: 400px;
}
form{
    padding: 30px 40px;
}
h2{
    text-align: center;
    margin: 0 0 20px;
}
.form-control{
   margin-bottom: 10px;
   /* 错误提示挤出空间 */
   padding-bottom: 20px;
   /* 给错误提示做定位的参考对象 */
   position: relative;
}
.form-control label{
    color: #777;
    display: block;
    margin-bottom: 5px;
}
.form-control input{
    width: 100%;
    display: block;
    border: 2px solid #f0f0f0;
    padding: 10px;
    font-size: 14px;
}
.form-control input:focus{
    outline: 0;
    border-color: #777;
    border-radius: 5px;
}

/* 错误提示 */
.form-control small{
    color:var(--error-color);
    position: absolute;
    bottom: 0;
    left: 0;
    visibility: hidden;
}

/* 输入正确输入框的颜色 */
.form-control.success input {
    border-color: var(--success-color);
  }
  /* 输入错误输入框的颜色 */
  .form-control.error input {
    border-color: var(--error-color);
  }

  .form-control.error small{
      visibility: visible;
  }

.form button{
    cursor: pointer;
    background-color: #3498db;
    border: 2px solid #3498db;
    border-radius: 4px;
    color: #fff;
    display: block;
    font-size: 16px;
    padding: 10px;
    margin-top: 20px;
    width: 100%;
}


